#include <stdio.h>
#include <string.h>
int main() 
{
    int a[20], i,j;
    char* fenge="";
    for (i=0; i<20; ++i) 
    {
        scanf("%d", &a[i]);
    }
    for (i=0; i<20; ++i) 
    {
        for (j=0; j<20; ++j) 
        {
            if (i == j ) 
                continue;
            if (a[i] % a[j] == 0) 
            {
                printf("%s%d", fenge, a[i]);
                fenge = " ";
                break;
            }
        }
    }
    return 0;
}
